add #6 - #17
fix bug in 3 and 4