Cleaned up demo.cpp