Fixed arch 3; cleaned up code.