consolidate

Conslidate multiple functions in the one script