Added median filter

Fixes #2