First draft implementation of assignment 3.