fixed bug by normalizing earlier