implementing some TODOs