refactored mathIssues solution