improved serialization
finally made the project compile
refactoring 3