added some add item code
added jQuery and refactored code