added hw2 files
modified similarity with pthreads