added realloc greater than case
merge changes