fixed todo, plus fix minor bug