almost there. fixed a scoping bug in printer