first function works, I believe
more revisions