completed implicit scratch behaviour; cleaned up code formatting and
warnings; extended xml header;