Structural changes in code

moved functions from elev.c and elev.h to ui.c and ui.h