Updated it so that the code actually works