better dependencies calculation