Code works correctly.