errno outputs added, comments added