final solution complete