codes complete, test and docs