rename buffer -> real_buffer to avoid clashes in nn