finalized logic, updated display