major fix

fix cornercases, add 'gesture' mode, unify port addressing