converting drawing back to function calls