All variables named properly, unnecessary stuff taken out, works for both tabs