Now using php's extract function instead of looping over the array