take the api given by PAB and brush it up a bit, put it into the same file that's been done recently by Tomasz