initial check-in

modernized version of the original code