refactored model to allow for multiple alternating losses wrt different variables, getting erratic behavior overall