Added number of paths calculation