add function to calculate distance from coordinates, and select source according to the result; add cloudIp to userInfo class and table