Some refactoring of the inputs to be more general

Confirmed to match the SAM API samples. Further expansion may diverge by
changing defaults.
Automatic Cost Calculation

Added a method to automatically calculate the costs based on the array
size and several parameters.