So much trouble getting shift algorithm. Seems to be working now

Should probably write tests and shiz