formed the base for programming extra heuristics (form_expression function)