created helper function