Started on new main code for chipmachine