lots of rewriting, added in depth beginner example