Fixed Bugs

Code made me feel sick. So I made it look better.