First version of the implementation with the generics.

First version of the implementation with the generics.