Basic Error Handling added and commented