Implemented size handling more dynamic