Having trouble with portioning