Code for Kaggle competition (incomplete)