following the example from class