Fixing some bugs with refreshing, adding beginning code for determining location