totally changed api and updated docs