some algorithms showcases neat uses of loops and conditionals