Implemented generics and added unordered/ordered feature.