add outputAttributes and combine 2 scripts together