improved add function, added empty constructor