added location calc stuff