Refactored the code. Add a vms array
Refactored. Now working
Removed idle threshold criteria. Workable version
intermediate commit