cosB now returns signed values