took out unused checks and implemented a null entries check