Cleaned up morecore function.