Beta v1.01

bug fixed, optimize code