updated logic, output, and readme file