Changed code to use path ways