fixed bug in orientation calculation in hex/hex.c and hydram.c