added feed forward function