trying to resolve memory leak
finally figured out what was causing the segfault - the 'moists' input. All inputs have been made 20 years long now