added few specs and fixed some bugs