STUPIDROBOT - fix the matching problem for dynamic length input
modification of database query, new method added