Reorganized code

HAHAHAHAHA it's too big a change for GitHub to show!