first completed version
completed, no compiler error - not tested