updated to implement method you defined