Fixing style and calculations