implemented expand data with and without overflow