add mode buttons
add zoom/pan. tweak layout.  improve style. separate utility functions.