Closed #3 with some changes.