Modified to accept any size for the parameters