Sync'd up with C version.