form from https://github.com/viliusle/miniPaint/