created function for testing moments calculation