fixed framebuffer, added method to write pixels