Add ugly recording function.
Do some changes.