replaced matchShape with self defined features