Major improvements to wrapper