commented the functions and added a few TODOs