Deleted old file and rewrite some function.