filled in some of the TODO: areas