Improved wrapper and added time measurement