Modified to accept several parameters