Moved squash function out into its own file.