added collision detection for building a base