implement 21 with some standard library functions
clean up some indentation