Optimalized code, included success indicator