Added location logic