somewhat working prog4