Cleaned up some code for the tutorial