fixed some code and added a TODO