Working. Now need to to clean up and merge with master