Fixed matching.
Ready for optimization