error checking needed. filesize checking as well.