new functions: takeWhile and takeWhile_i