Updated to Alpha 5 and general rewriting