split into separate function. explain heuristics
split into separate function. explain heuristics

MahmoudFouad/samples,akashrchoksi/newone,taylor-b/samples,oliverhuangchao/samples,xdumaine/samples,shelsonjava/samples,smbale/samples,dushmis/webrtc,guoweis/webrtc,martin7890/samples,b-cuts/samples,knightsofaa/webrtc,MahmoudFouad/samples,mvenkatesh431/samples,procandi/samples,dajise/samples,smayoorans/samples,jjrasche/cell-based-RC-control,pquochoang/samples,fetterov/samples,samdutton/webrtc,Edward-Shawn/samples,xdumaine/samples,tsruban/samples,Roarz/samples,procandi/samples,Roarz/samples,leehz/samples,smbale/samples,bbandaru/samples,fitraditya/samples,EmreAkkoyun/sample,EmreAkkoyun/sample,akashrchoksi/newone,overtakermtg/samples,guoweis/webrtc,kod3r/samples,overtakermtg/samples,smbale/samples,dushmis/webrtc,webrtc/samples,jjrasche/cell-based-RC-control,mauricionr/samples,procandi/samples,pquochoang/samples,TribeMedia/samples,leehz/samples,shaohung001/samples,shelsonjava/samples,bbandaru/samples,mulyoved/samples,b-cuts/samples,ralic/samples,leehz/samples,kod3r/samples,todotobe1/samples,volkanh/volkanh.github.io,keshwans/samples,fetterov/samples,webrtc/samples,myself659/samples,TribeMedia/samples,shelsonjava/samples,TribeMedia/samples,dajise/samples,virajs/samples,keshwans/samples,askdaddy/samples,MahmoudFouad/samples,fitraditya/samples,bbandaru/samples,ralic/samples,bemasc/samples,smayoorans/samples,kod3r/samples,dajise/samples,fitraditya/samples,guoweis/webrtc,tsruban/samples,myself659/samples,jjrasche/cell-based-RC-control,fippo/webrtc,Edward-Shawn/samples,bemasc/samples,pquochoang/samples,smayoorans/samples,Edward-Shawn/samples,volkanh/volkanh.github.io,virajs/samples,fippo/webrtc,mvenkatesh431/samples,jjrasche/cell-based-RC-control,mauricionr/samples,samdutton/webrtc,askdaddy/samples,mulyoved/samples,overtakermtg/samples,Roarz/samples,oliverhuangchao/samples,shaohung001/samples,volkanh/volkanh.github.io,fetterov/samples,b-cuts/samples,bemasc/samples,xdumaine/samples,mauricionr/samples,taylor-b/samples,knightsofaa/webrtc,mvenkatesh431/samples,mulyoved/samples,todotobe1/samples,myself659/samples,martin7890/samples,oliverhuangchao/samples,martin7890/samples,tsruban/samples,akashrchoksi/newone,EmreAkkoyun/sample,virajs/samples,todotobe1/samples,ralic/samples