anca's changes
added docs and made it more general than lgenesis