implement problems 1-15 and 17