Algorithim cleanup