adding in methods from robert's code