puts command in correct section of file