adding code to verify algorithm
adding code for timing tests