Removed space tabs, fixed difference function