extended examples + code clean up