Added core functionality, not entirely tested