Added more functionality. Doesn't completely run.