implemented first two methods