restructuring tail code, inputing model data for body,tail,head construction