porting getting_even