Changed rendercode

- Now uses the database