Added more error handling, changed some formatting. Added debugging / GDB section.