added --cast option