Reordered functions, eliminated trash.