Added generics as to John's request