Refactored some names
Same partial changes
Implemented monitor-wait
Improved monitor_shift function