return a result from the logic function
fix pep8 error