Initial copy of original code

Initial copy of original code