dialyzed, cleaned up, beginnings of documentation