added flash reading and writign when flash flag is set, ofc not wokring yet, because of these pointers