Rephrased and cleaned code.