remove unused function applyStyles
tidy up getAttributes function
Comments added, JSDoc notation
update min