randomized the path a little bit and cleaned up some code