Main source code. Fixed countdown from freezing.