Edited if statements to eliminate waste-spacing code, thread sleep intervals shortened for performance