added better python checking