updated to implement serializable