hannes version
merged hannes version, fixed some errors
TODO fix code box to align with template