Now outputs cordinates to file. Added necessary framework and did necessary changes to main. Some cleaning in main.