Added NullPointerException
Renamed variables