changed queue and stack to use generics