A sample implementation of custom views. Standford CS193p