final solution v2