almost there maybe
merge conflict adjusted