added option to input frequency as an argument when initializing Z.