Fixing broken code because I was tired