open-sourcing this (I have no idea why it was private in the first place)