reworking collision detection..still not working
changed methods from double to int