made pep8 compatible and added __main__ function