foursquare logic