added whamp matrix preparation