Made adding parameters to RHS more robust. Still need to optimise
formatting though.