Changed vector input to RAtoAi to a reference input, added alternative formulation but commented it out

significant speedup