-Basic modifications to make sample work correctly