added in temp gen alg