Codes were modified for new model interface