converting to bilateral blur - working version