Applied pep 8, updated tests and updated comments.