updated. added tests