changed data structure and reformatted
merge with master