A model for fingerprint formation