Updated version with debugging info.