Merged it with some changes. Thanks!