modified code format for readable.