ditching the linear approximation stuff
now solving properly with some additional constraints
rearranging and getting rid of old constraints