Removed unused functions, added threshold_clipping, commented out positive shifting. Comitting this only to get the changes onto my science repository. For Ticket #129.