first draft of wrapper
some small alterations for debugging