endo matching done. needs more testing