moved compile method up