Note: I removed the ClassTag for V, as it was not necessary. Also, I reordered the type parameters to put K in front.