slight refactoring, added init and ptr call fns.