added more documentation and some todos