database storage and retreival works, added javascript magic