Updating to ryanjon's version