added compile method to view class