fixed deletion
Added comments and formatted the code for readability. Added parseDemand() function