algorithm example works
main example wotrking again