Edited constructor to match add() method.