implementing sequence serialize