written assignment 4 final
first workable version