made small changes and added tests