added support for optional parameters