Reimplement ps based on cs