added some more helper functions and commentss
...