Did PE015 and PE022 in python - still need to clean up the code