Wrote loc/getloc and tests - nearly done!