added multi-core support