so far only copied a function to later upgrade it to 3-way comparison