[modified] reordered functions