added speed effect and did some refactoring