added permutation statistics and added a check for increasing and decreasing sequences