Refactored code into cleaner class structure. Fixed downsampling bug with data clipping