implemented resize factor, solved some issue