Tested code

Tested code. Worked as expected.