Messed up but fixed.

Made a ton of error with coding late at night, mainly with some else statements that basically closed the entire function when all I needed it to do was to close a else if statement and a if statement. But I fixed it.