Solution to problem 30 added. stick-num function rewritten