changed normalize to adapt to sub and added sub test