Updated version with debugging refs #11