followed@aashish24 advice, using dictionaries