a bit of tidying up, added some init parameters
Automatic style corrections courtesy of autopep8