new subroutine for input frequencies