THIS COMMIT DOES WAY TOO MANY THINGS BUT IT SEEMS TO WORK