Mohamed's latest code along with variable/constant update by Ben.