hopefully fixed bug (have to length normalize)