implement menu and leet function

some general cleanup and optimization
exception handling