remove use of deprecated method
fix q1,2,4,5. implement q3
style/comments