adding solution for problems #14, #15, #16