Adding function and class for communicating with flash