code complete on #61

now for debugging and testing.

much cleaner, i hope this works...