removed double buffer, cleaned up debug output