refactored code to use a showHide method instead of having .show()'s and .hide()'s everywhere
fixing warnings
fixing warnings