fixed additional calculation
added support for opts hash when args > 3