Saving/loading user defined patterns to file