Added some of the features of Optional.

I have added some optional features.  If seems fine pull to upstream.