Speeding up the computation