Made registration more foolproof, better documented