greatly simplified the nonlinear files, eliminating repeated code