removed unused oldRelated array
formatted multiline statements to have consistent spacing