filtering erroneous compass values

Ive tried posting them here. Keeps on failing. Had put in a description and everything but its lot now.
The pictures are here: ArduinOrama | gr0p3r

an video showing its functions is here: ArduinOrama - YouTube

Iva also attache my code in entirety in case it ever interests anyone.

pano_compass2.ino (8.39 KB)