added proximity code