big deletion on this branch, starting over
now working. ugly but working