edit code for clarity