fixed dot verus arrow notation, added writeImage function