Added non parallel function for correlation calculation