added a bit of test, inline functions, and changed wrapper