Changed hw8 pr2

made changes to file for efficiency