completed #2 and fixed #3