Added data gen function