move all book code into compiler.py