solution from class