Created wrapper, fixed calculation errors