added corr function for assignment 2