Speeding up the code.