Finished code, testing time