updated and fixed exercise