Added more casting and initial encapsulation example