fixing 4 of 5 bugs