improved code readability, aesthetics, and added speed slider