added theory and edited some things