added commented code from Emil Axelsson and Erik Larssons project