making it accept dynamic data