fix problems 1, 3, 4