- Added changes to the code to improve the functionality.