added editing loop at end of sscanf while