added preliminary clone function, fixed bug, added test for reset method