some modifications done and added intializeSensorsOnPerimeter function