Fixed Code

I am pretty sure this works