added compass contrast function