cleaning up the python

cleaning up the parser a little,
maybe ill add some tests as well