Tried to fix issue regarding the answer put on the table; made code easier to read