Imported Johans code to lab4C package