Added vector length function to tools and used it in the normalize function