parses a single argument
added casting
added proc casts
parses flags
implemented defaults
improved documentation