Updated angle difference code.