Consider this rewrite, might be more readable

Feel free to erase these pull requests too