swap around, added some duplication and separated some sections