fixed duplicate dfn of orientaiton
other small fixes and cleanup