Still trying to debug ifs. Moved accidental logoff. Added table prints and echos