solving preoblems