Finally compiling yet some definite logic issues

possibly in add() or keyExists()