Added solution for frequency