Updated MCD and SQL scripts