re-worked dict lookup