size changes; made functions more readable and consistent