finished refactoring to use functions to calculate one- and two-dimentional correlants