finally done with overall functionality