removed zillion of compiler warnings due to mising casts between