Final implementation of code. Writing paper and generating results with different inputs