Short pass on the code, added comments and todo tasks