modifications to challenge3 (addRecord function)