added comments, specs, some fixes