implement single-pixel write

The write operations need a refactoring
(move common post-write tasks into functions)