massive UMBC code import -- this patch does a lot of stuff