A lot of changes - added DB queries for most options