code complete. need to test.