changed some layout, changed read file mechanism to make it work platform independent