keys changed to more general cases