refactored CLIP_Analysis, basically everything, added some (bad) unit tests as well