got rid of some variables that shouldn't be necessary, need to rework
keygen and envgen