Adds digi's console code from CC (adapted)