Used a main function
Added code to select only the monitored partitions