Fixed drag calculations
Various code refactoring