added some boundary checkers to parse method
added more docs and boundary checkers
autopep8ed