adapted for my needs, no tables eg