cost is now HashMap links