Added return statement and costFunction returns euclidean as default for now.