added exercise with external variable use