refactored simple solve