pretty much a cut-n-paste job, just had to get the right imports