Changes sent to me by Josh and bug fix