some old learning code