Applied pep8 and added legend to 3.11