added some file and array utilities. implemented pattern search.