added CreateLevel function