changed cossim and commented code