fancy database writing