Simplify breathing algorithm.

Stumbled on your breathing algorithm, and simplified it a bit for a project of mine. Thanks for helping me out, hopefully I can return the favor :)