This is only for study purpose 
DO NOT use this code in a real system.