cleaned up code, repaired single byte video write