updated node collision to use objects and call the collison function