Added defensive programming to the Cell class, also re-factored the class