removed extra 'end' that was causing the model to crash