Add simplify function