fixing 3 of 5 bugs