Warnings and comments added for code readability.