Wrote almost the whole assignment