Added loading spinner, updated prediction alg