done the core functionality