Updated ScratchEdit function

Made it leaner and simpler