greedy, slightly hacky