A bit of defensive programing and a lot of comments