some modifications has been made. Still not working yet