add random obstacle and pure functions for collision