fixed a little bug, added 2 <=> 16 support, code cleaned up a bit