Fixing freq() and adding mode()