added code that Jakob and I worked on