Create trim.c

Version 1 of trim system.