created function names and reordered