changed to parameter assertion
added some parameter assertions, checks, and fallbacks