fixed PEP warnings. Added levels. I hate your face.