merging
fixed overflow problem