working version as a simple wrapper