Moved print after loop