removed the unnecessary gen function