auto size calculation
Merge remote-tracking branch 'upstream/master'

merged from original repo to add auto size calculation