rearranged to fix some layout issues