fixed logic, hopefully made table small enough