Final version for as midterm project work