begin task 3 & fix a minor bug