Small refactoring, now also checks if pin is even valid in the first place: is the size acceptable? Minimum length is 3, max is 20.