updated basic.inc and added joins to database