Moved filter_pairs function to recalc
Fixed and documented script* files