Added general use algorithms; started work on train tracking algorithms