added solution for path action state with list comprehension