Fixed the direction issue, needs testing