Looked through code, made minor changes. NEED TO REFACTOR.