Added comments
Added check for keys