trimmed code some more, added more inline docs/todos