Cleaned up and commented example