Added check for if it already sprayed

Make sure it doesn't spray the same pixel twice and cleaned up the code.