Updated and completely functional ddl script