'changed scalar multiplication and added functions to check collision and calculate distance'