written structure for next function in beating