added options parsing for greater control.

using the OptionParser ruby library.