added a generic linear search and a check_args function to utils