Initial wrapping of Javad's code to perform timings.