more sophisticated but broken