added optional and default vals to spec. Created AgentSpec helper class.