moved code around

just to make it look nicer