improved io and added parser