gem-ify this bad boy. and add license (oops)