Changed filesize code to improve speed.