edit some names and reorganized functions.