Modified instructor code to synch ld output