refactored Kaggle tutorial