updated based on some comments from Harsh