Added Andre's new stuff as well as a new implementation for Proximity detection