added specs and fixed some bugs while testing this thingy