functionality of servlet nearly done