adding in obstacles, cleaned up and commented code