corrected some typos, added another case to the collision checking