remove trailing spaces
remove trailing spaces
fixed #3: replace protype functions with jquery