changed findOpt to not loop