checks for arguments count and unused parameters