tried making collision detection within class, not working