Original Code before modifying to make better