S.Buckley: needs refactoring, but works