working on image manipulation code