Added turnDirection(), findLowestY() and scan()

used midtermTest.txt problem on the midterm to test the accuracy