FIX: initialize nextt to zero