one line less
added 2 more checks
added some TODOs