Try to understand main function and the scheduler

TODO
- Study more
- Read more