Changed collision detection such that each object has a state