implementing jquery functionality