added some, removed a few lines