some shuffling.
need to add normalization to functions.