shadi mubbrak updated code 10 dec 2014