added print statements to server subroutine to debug, made qdev a static int for global access