deck structure and refactor, pep8, clean up and tests