keep_while function

Keep values at the start of .x while .p is true