Added clean version of code.