Working create function