there's a new bug, but this is neater anyway