RF: move calc_pos_neg to own function, added tests