integrated everything, will now print error, doesn't adjust for errors yet