improved code for filtering params. initially slice() would add new keys with nil values if they didnt exist. not anymore.