Added header documentation; renamed vector variable, added parameter validation.

Signed-off-by: Dave Poirier <ekscrypto@gmail.com>