arranged some code