Added functionality  to compass program