roughed out solution to compare and store