creating support functions
updating memory block