Both are worked. The last version is smartest