Mode Location related code