Tutorial code gutted and put back together.