rearranged checks to put userdata checks together in output