fixed outputdir and added tests