edit boundary functions for collision detection