code beutyfy and var fixed