algorithim fixes
michael temp merge