Added enemy AI / Fixed distance function