Added commentary on logic, todo items and some new tests