Added collision logic