Fixed the code I wrote at work. It runs now.