Disclaimer: Written to best of knowledge. No guarantee for correctness. Please: Re-contribute by creating a pull-request if you make changes!