resolving #3 and some other minor TODOs