My sad attempt at getting this function to work. Harrison is going to help me with it in a few minutes