factored out square creation