history function revised to use security as columns