Add derivative calculations to code
Fix bus