@maojrs modifications under updated version