Filling in cloning functionality and tests