updated to __call__ method instead of calculate_freqs and assemble_matrix for state_freqs and matrix_builder, respectively