code from the last three classes