added q lib
implemented q