Incorporating the latest changes present in nlondhe's code