Added select plan 1 structure, changed ql.h to add some needed functions