added final solution