added code for sequential models