adds method I saw on Stack Overflow, I will think about how I can do this in my own way