fixed require() and added tests