Creating optimal Solution