refactored Frequency for use jscience library