Rename variables for readability; Fix attachments bug;