add new versions and improve code,all is ok for now