continued working on  #8, #9, #10 and #12 due to close #19
also found a solution for #20