merging Mike's code
merge Mike's code