Implementation of A*. VERY BUGGY. DO NOT USE THIS BUILD