updated continuous vs discrete code