Created better button logic