A time-dependent multistate model for bacteriorhodopsin photocycle