Fixed #3 - added tests