hw8 done, although execution time is very long