fix indentation; change to return array of objects