add main framework code