implemented error printing facilities & querySwap