fixed #1 and add timing prints