check branch
re-factored doSize function