Second version. With console messages