added serialization functionality
completed test cases for serialization and cloning