cleaned up function layout.