moved templates around to be easier to use
also, redefined the correlation calculation into a library