Generate bundle function working now