array mapping added
clear whitespace and add comments
cors added for xdomain testing