really laborious way of getting the direction of the pin into the json file