this is to save major java codes