Core algorithm imported. still not working