Code paranoia
Added some documentation