Stick problem code