Replaced slice with take method.