Final Working code for ArrayMon