adding comments and code from Lora's help