updated with solution