merged code together