Added some calculations for handlecollision
Commented some code