working, but slow
still slow, but using the barlocker method
Allow optional fields.