initial commit

Working out some bugs before optimization