created more tests to check the validity of the attributes param, moved attribute string concat into dedicated function, fixed spacing issues