trial code from newcoder.io