refactored to include jasons recent updates