things sort of working.  need to debug quadratic stuff though