add spec and some fixes