finished basic functionality & added tests