main class

Refactored a bit.
Still need to compare to wave format.