Re-wrote the whole python program - removed reversed dictionary creation