refactored the zenity table function

also improved comments