changed main stuff to include some register changes