removed some reduant code ad added comments now t make a python version