Neatened code, added greater variable use