stack overflows. too bad. cannot figure out how to get it to use less stack