adding file handeling and pickeling