fully working except for some printing