some scripts and cleanup
added new matching code