Nearly working version of location selection