Moved a bit of Toms example to actual code