refactored clock DOM manipulation and implemented master input freq.