Removed third node and renamed some variables to be more descripive.