refactor PPU
add comments