all done without multythreading