I mean, I think this is par for the course by anything written by a grad student. Be thankful it's not written in matlab