moved over code from first project