End of the first try
Same concepts but with generics