added functionality to addAttribute

also edited the constructor that takes attributes as arguments

note: still have to implement error checking for addAttribute