Code works as specified.