Started on code generation for casting