Flags 1

First pass at using flags,a map,a function type and various implementations.