Added logging, renamed vars and methods for PEP8, updated doc