Finished implementing median filtering.