1. structuring the code to various cases in main.
2. adding TODO's