Commmented and added error checking