Changed and refactor code

Not working due to error in initializing world