Rewrote this program so it isnt flaming doo-doo