fixed bug introduced in last commit; worked on some todos