changed the api a bit