Finished coding and fixed all bugs

Also added timing code