adding attribution and fixing bug