add Direction enum and fix format.