fix a bunch of things
fix result handling procedure