Code written to solve some linearity problems.