add utility functions (standalone) writesize and readsize
can add second viewport