static short avgShort(short a, short b) { ret (short) ((a+(int) b)/2); }