massive edit too much to explain.