Added collision checking