added simplize function