t651 merged some previous code