Adding function to calculate returns