open source rewrite of swagulatzius