modified scratch stuff, job control, got rid of redudant stuff