Increased performance, fixed calculation errors