Finalized changes. Added reference for non rotation-invariant uniform patterns. Added test case. Modified comments to clarify the process, and changed the code to make it more consistent with explanations and actuall encoding