Rearranged ordering of functions in test code for readability
Added dot product