Finished porting over old version