Implemented a shoddy median filter algorithm. Seems to work perfectly