PowerOf4 Final Code