solution to #14
solution to #15
solution to #16