Clean up set implementation and add comments to save