extending and inheriting objects using prototype