solution to written exercise and first programming tak