Porting Scheduler Code

Porting scheduler from github.com/vladimirvivien/gomes project.